#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
const int MAXN=1e7+3;
bool is_prime[MAXN];
int prime[MAXN];
int euler[MAXN];
int p_cnt;
ll cnt[MAXN];
void Init() {
	memset(is_prime, 1, sizeof(is_prime));
	memset(prime, 0, sizeof(prime));
	for (int i=1; i<MAXN; ++i) euler[i]=i;
	p_cnt=0;
	for (int i=2; i<MAXN; ++i) {
		if (is_prime[i]) {
			prime[p_cnt++]=i;
			euler[i]=i-1;
		}
		for (int j=0; j<p_cnt&&prime[j]*i<MAXN; ++j) {
			is_prime[prime[j]*i]=false;
			if (i%prime[j]==0) {
				euler[i*prime[j]]=euler[i]*prime[j];
				break;
			}
			else {
				euler[i*prime[j]]=euler[i]*(prime[j]-1);
			}
		}	
	}
}
int main() {
	Init();
	cnt[0]=0;
	cnt[1]=1;
	for (int i=2; i<MAXN; ++i) {
		cnt[i]=cnt[i-1] + 2*euler[i];
	}
	ll res=0;
	int n;
	cin>>n;
	for (int i=0; i<p_cnt&&prime[i]<=n; ++i) {
		res+=cnt[n/prime[i]];
	}
	cout<<res<<endl;
	return 0;
} 
